# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MigrationCenter.V1.Model.PerformanceSample do
  @moduledoc """
  Performance data sample.

  ## Attributes

  *   `cpu` (*type:* `GoogleApi.MigrationCenter.V1.Model.CpuUsageSample.t`, *default:* `nil`) - CPU usage sample.
  *   `disk` (*type:* `GoogleApi.MigrationCenter.V1.Model.DiskUsageSample.t`, *default:* `nil`) - Disk usage sample.
  *   `memory` (*type:* `GoogleApi.MigrationCenter.V1.Model.MemoryUsageSample.t`, *default:* `nil`) - Memory usage sample.
  *   `network` (*type:* `GoogleApi.MigrationCenter.V1.Model.NetworkUsageSample.t`, *default:* `nil`) - Network usage sample.
  *   `sampleTime` (*type:* `DateTime.t`, *default:* `nil`) - Time the sample was collected. If omitted, the frame report time will be used.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cpu => GoogleApi.MigrationCenter.V1.Model.CpuUsageSample.t() | nil,
          :disk => GoogleApi.MigrationCenter.V1.Model.DiskUsageSample.t() | nil,
          :memory => GoogleApi.MigrationCenter.V1.Model.MemoryUsageSample.t() | nil,
          :network => GoogleApi.MigrationCenter.V1.Model.NetworkUsageSample.t() | nil,
          :sampleTime => DateTime.t() | nil
        }

  field(:cpu, as: GoogleApi.MigrationCenter.V1.Model.CpuUsageSample)
  field(:disk, as: GoogleApi.MigrationCenter.V1.Model.DiskUsageSample)
  field(:memory, as: GoogleApi.MigrationCenter.V1.Model.MemoryUsageSample)
  field(:network, as: GoogleApi.MigrationCenter.V1.Model.NetworkUsageSample)
  field(:sampleTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.MigrationCenter.V1.Model.PerformanceSample do
  def decode(value, options) do
    GoogleApi.MigrationCenter.V1.Model.PerformanceSample.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MigrationCenter.V1.Model.PerformanceSample do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
